package org.jwcloud.project.module.zx.taskWarnManagement.controller;

import com.jw.mid.mm.comm.common.controller.BaseController;
import com.jw.mid.mm.comm.common.json.Response;
import com.jw.mid.mm.comm.common.pagination.PageListSlice;
import com.jw.mid.mm.comm.common.pagination.Pagination;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.jwcloud.project.module.zx.common.Resp;
import org.jwcloud.project.module.zx.taskSupervision.service.TaskSuperviseService;
import org.jwcloud.project.module.zx.taskWarnManagement.service.TaskWarnManagementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Api(value = "API - Controlle",
        description = "项目预警管理-超时预警信息管理", tags = "projectWarningManagement")
@RestController
@RequestMapping("/rest/taskWarnManagement")
public class TaskWarnManagementController extends BaseController {

    @Autowired
    public TaskWarnManagementService taskWarnManagementService;

    @GetMapping("queryOvertimeMessageList")
    @ApiOperation(value = "超时预警信息管理", notes = "超时预警信息管理  分页")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "project_name", value = "project_name", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "duty_unit", value = "duty_unit", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "duty_dept", value = "duty_dept", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "is_done", value = "is_done", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "reply_flag", value = "reply_flag", required = false, dataType = "string", paramType = "query"),
            
            @ApiImplicitParam(name = "query_all_type", value = "查询全部类型（鱼骨）：1", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "rel_project_id", value = "项目id", required = false, dataType = "string", paramType = "query"),
            @ApiImplicitParam(name = "rel_task_id", value = "任务配置id", required = false, dataType = "string", paramType = "query"),
            
            @ApiImplicitParam(name = "not_duban", value = "未点击督办1（目前只有右上角写1）", required = false, dataType = "string", paramType = "query"),
            
            @ApiImplicitParam(name = "finish_state", value = "{key: '01', value: '未完成'},\n" + 
            		"  {key: '02', value: '按时完成'},\n" + 
            		"  {key: '03', value: '超时完成'},", required = false, dataType = "string", paramType = "query"),
    })
    public Resp<Response<PageListSlice>> queryOvertimeWarningMessageManagement(
            Pagination pagination,
            @RequestParam(required = false) Map<String,String> param
    ) {
        return taskWarnManagementService.queryOvertimeWarningList(pagination,param);
    }

}